VR is a computer simulation system that can be used to create and experience a virtual world. VR generates a simulated environment by using a computer, and is a system simulation of multi-source information integration, an interactive three-dimensional dynamic vision, and entity behavior, so that a user can be immersed in the environment. Currently, the VR technology has been widely used in many fields such as games, industry, and shopping. In some application scenarios, a password needs to be input. For example, when some functions are enabled in a VR scene, password verification can be performed.
A method for inputting a password in the existing technology can be as follows: A virtual keyboard is presented in front of the user in the VR scene, and if a gaze focus of the user stays at a character on the keyboard for more than a certain time, it indicates that the character is input. However, a disadvantage of the method is that a misoperation is easily performed, for example, a misoperation is easily performed when the user is thinking or when the focus of the user accidentally stays at a virtual key in a process of taking off a VR device. In addition, a password input time is long in the method. When a password of the user includes relatively more characters, the user needs to perform a plurality of times of input. In addition, because the user needs to make the focus stay at a virtual key for a specific time before the user triggers input, if a stay time determining threshold is relatively small, a misoperation probability is relatively high; or if a stay time determining threshold is relatively large, an input process is relatively slow.